<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>销售台账列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .table > tbody > tr > td {
            height: 30px;
            max-height: 44px;
            overflow: hidden;
            padding: 0 2px;
        }

        tbody {
            font-size: 12px;
        }

        .saveModle {
            width: 500px;
            height: 300px;
            position: fixed;
            top: 50%;
            left: 50%;
            margin-left: -250px;
            margin-top: -150px;
            background: #fff;
            border-radius: 10px;
            z-index: 1978;
            display: none;
            border: 1px solid #cfcfcf;
        }

        .saveModle .top {
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            padding-left: 7px;
            border-bottom: 1px solid #cfcfcf;
            background: #fff;
        }

        .saveModle .top .title {
            height: 32px;
            line-height: 32px;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            float: left;
            background: #fff;
        }

        .saveModle .top .btn {
            font-size: 20px;
            width: 34px;
            height: 22px;
            line-height: 12px;
            display: inline-block;
            float: right;
        }

        .saveModle .top .btn:hover {
            color: red;
        }

        .saveModle .saveBtn {
            margin: 0 auto;
            margin-top: 35px;
            display: block;

        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        p {
            display: inline-block;
            float: left;
            margin-bottom: 0px;
            line-height: 25px;
            padding-right: 15px;
            color: #228bee;
            font-size: 14px;
        }

        .td-value span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            color: black !important;
            /*display: -webkit-box;*/
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            max-height: 34px;
        }

        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: black !important;
        }

        .td-value span {
            display: inline-block;
            overflow: hidden;
            padding-left: 0.06rem;
            word-wrap: break-word;
            color: black !important;
        }

        .fixed-table_body tr td {
            border-right: none;
        }

        .fixed-table_header tr th {
            border-right: none;
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .fixed-table_body tr:nth-of-type(odd) {
            background: #F9F9F9;
        }
        .content {
            padding: 8px 8px 0 8px;
        }
    </style>
</head>
<body>
<section class="content" id="app">
    <div class="div-td-content-more"><i></i></div>
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div style="height: 25px;margin-bottom: 10px;">
        <!--<div class="pull-left" style="width: 120px;">
            <select id="selectCompany" class="form-control" style="width: 100%;height: 25px;font-size: 12px;line-height: 25px;padding-top: 0px;padding-bottom: 0px;padding-left: 6px;" v-model="searchParams.selectCom"  >
                <option value="">请选择公司</option>
                <option v-for="item in companyList" v-bind:value="item.id">{{item.name}}</option>
            </select>
        </div>-->
        <!--<input type="text" placeholder="客户名称" class="form-control pull-left input-sm"
               style="width: 100px;" v-model="searchParams.customerKey" id="txtParent">-->
        <!--<input type="text" placeholder="制作人" class="form-control pull-left input-sm"
               style="width: 100px; margin-left: 10px;" v-model="searchParams.createUserName"
               id="regionManagerName">-->
        <!--<input type="text" placeholder="序列号" class="form-control pull-left input-sm"
               style="width: 100px; margin-left: 10px;" v-model="searchParams.serialNo" id="">-->
        <select id="testCom" style="width:100px;height: 25px" class="pull-left" v-model="selectCom">
            <option value="请选择公司">请选择公司</option>
            <option v-for="itemC in itemsCom" v-bind:value="itemC.companyName">{{itemC.companyName}}</option>
        </select>
        <input type="text" placeholder="关键字" class="form-control pull-left input-sm"
               style="width: 200px;margin-left: 10px" v-model="searchParams.customerKey" id="txtParent">
        <button type="button" class="btn oaBtn btn-sm" style="margin-left: 10px;" @click="search">查询</button>
        <input type="button" class="btn oaBtn btn-sm pull-right"
               style="margin-right:5px;" value="导出客户信息"
               @click="exportGet()"/>
        <div class="pull-left divCheck" style="margin-left: 5px;">
            <input type="checkbox" id="cbCheck" v-model="searchParams.haveSettle" @click="searchAll">显示已结清
        </div>
    </div>
    <div class="box-body no-padding iframeH3" style="overflow: auto;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <div class="fixed-table-box head-fixed ">
            <div class="fixed-table_header-wraper">
                <table class="fixed-table_header" cellspacing="0" cellpadding="0" border="0">
                    <thead>
                    <tr>
                        <th style="width: 38px">
                            <div class="table-cells">序号</div>
                        </th>
                        <th style="width: 80px">
                            <div class="table-cells">公司</div>
                        </th>
                        <th style="width: 75px">
                            <div class="table-cells">交车日期</div>
                        </th>
                        <th style="width: 121px">
                            <div class="table-cells">合同编号</div>
                        </th>
                        <th style="width: 45px">
                            <div class="table-cells">区域</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">区域经理</div>
                        </th>
                        <th style="width: 61px;">
                            <div class="table-cells">客户名称</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">品牌</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">设备类型</div>
                        </th>
                        <th style="width: 72px">
                            <div class="table-cells">型号</div>
                        </th>
                        <th style="width: 80px">
                            <div class="table-cells">序列号</div>
                        </th>
                        <th style="width: 83px">
                            <div class="table-cells">销售价格(元)</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">以旧换新</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">付款方式</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">结清</div>
                        </th>
                        <th style="width: 61px">
                            <div class="table-cells">是否逾期</div>
                        </th>
                        <th style="width: 42px;">
                            <div class="table-cells">操作</div>
                        </th>
                        <th style="width: 17px" ></th>
                    </tr>
                    </thead>
                </table>
            </div>
            <div class="fixed-table_body-wraper iframeSaleFixed" id="divMain">
                <table class="fixed-table_body table-hover" cellspacing="0" cellpadding="0" border="0" id="tableMain"
                       style="width: 100%;">
                    <tbody id="tbList">
                    <tr v-for="(item,i) in list.main">
                        <td style="width: 37px;text-align: center;">
                            <div class="table-cell">{{i+1}}</div>
                        </td>
                        <td style="width: 80px;text-align: center;">
                            <div class="table-cell">{{item.seller}}</div>
                        </td>
                        <td style="width: 75px;text-align: center;">
                            <div class="table-cell">{{timeFormat(item.deliveryDate)}}</div>
                        </td>
                        <td style="width: 122px;text-align: center;">
                            <div class="table-cell">{{item.contractNo=='-'?'查看':item.contractNo}}</div>
                        </td>
                        <td class='td-tanZongStyle-line' style="width: 45px;text-align: center;">
                            <div class="table-cell"><span class="lineOne">{{item.regionName}}</span></div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell"><span  class="oa-name">{{item.regionManagerName}}</span></div>
                        </td>
                        <td style="color:#2a8cec;cursor: pointer;width: 61px;" @click="goDetail('look',i)">
                            <div class="table-cell">{{(item.buyer).substring(0,3)}}</div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell">{{item.brandName}}</div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell">{{item.deviceType}}</div>
                        </td>
                        <td style="width: 70px;text-align: center;">
                            <div class="table-cell">{{item.modelName}}</div>
                        </td>
                        <td class="td-tanZongStyle-line" style="width: 80px;text-align: center;">
                            <div class="table-cell"><span class="lineOne">{{item.serialNo}}</span></div>
                        </td>
                        <td style="width: 83px;text-align: center;">
                            <div class="table-cell">{{fmoney(item.salesPrice)}}</div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell">{{item.haveReplacement==1?'是':''}}</div>
                        </td>
                        <td class="td-tanZongStyle-line" style="width: 61px;text-align: center;">
                            <div class="table-cell"><span class="lineOne">{{item.buyType}}</span></div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell">{{item.haveSettle=='1'?'是':''}}</div>
                        </td>
                        <td style="width: 61px;text-align: center;">
                            <div class="table-cell">{{item.haveOverdue==1?'是':''}}</div>
                        </td>
                        <td style="width: 42px;text-align: center;">
                            <div class="table-cell">
                                <!-- <a href="javascript:void(0);" @click="gotoDetail(item.id,'browser')">&nbsp;查看&nbsp;</a>-->
                                <a href="javascript:void(0);" @click="goDetail('edit',i)"
                                   v-if="isShowBtn('salesAccountEdit')">&nbsp;编辑&nbsp;</a>
                                <a href="javascript:void(0);" v-else
                                   style="color:#ddd;cursor: no-drop">&nbsp;编辑&nbsp;</a>
                            </div>
                        </td>
                        <td class="tdMore" style="border-left: 0px;"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <!--<table class="table table-hover  text-center table-striped">-->
        <!--<thead>-->
        <!--<tr>-->
        <!--<th style="width: 37px">序号</th>-->
        <!--<th style="width: 80px">公司</th>-->
        <!--<th style="width: 75px">交车日期</th>-->
        <!--<th style="width: 122px">合同编号</th>-->
        <!--<th style="width: 45px">区域</th>-->
        <!--<th style="width: 61px">区域经理</th>-->
        <!--<th style="width: 61px;">客户名称</th>-->
        <!--<th style="width: 61px">品牌</th>-->
        <!--<th style="width: 61px">设备类型</th>-->
        <!--<th style="width: 70px">型号</th>-->
        <!--<th style="width: 80px">序列号</th>-->
        <!--<th style="width: 83px">销售价格(元)</th>-->
        <!--<th style="width: 61px">以旧换新</th>-->
        <!--<th style="width: 61px">付款方式</th>-->
        <!--<th style="width: 61px">是否结清</th>-->
        <!--<th style="width: 61px">是否逾期</th>-->
        <!--<th style="width: 42px;">操作</th>-->
        <!--</tr>-->
        <!--</thead>-->
        <!--<tbody id="tbList">-->
        <!--<tr v-for="(item,i) in list.main">-->
        <!--<td>{{i+1}}</td>-->
        <!--<td>{{item.seller}}</td>-->
        <!--<td>{{item.deliveryDate}}</td>-->
        <!--<td>{{item.contractNo=='-'?'查看':item.contractNo}}</td>-->
        <!--<td class='td-tanZongStyle-line'><span class="lineOne">{{item.regionName}}</span></td>-->
        <!--<td>{{item.regionManagerName}}</td>-->
        <!--<td style="color:#2a8cec;cursor: pointer;" @click="goDetail('look',i)">{{(item.buyer).substring(0,3)}}</td>-->
        <!--<td>{{item.brandName}}</td>-->
        <!--<td>{{item.deviceType}}</td>-->
        <!--<td>{{item.modelName}}</td>-->
        <!--<td class="td-tanZongStyle-line"><span class="lineOne">{{item.serialNo}}</span></td>-->
        <!--<td>{{fmoney(item.salesPrice)}}</td>-->
        <!--<td>{{item.haveReplacement==1?'是':'否'}}</td>-->
        <!--<td class="td-tanZongStyle-line"><span class="lineOne">{{item.buyType}}</span></td>-->
        <!--<td>{{item.haveSettle=='1'?'是':'否'}}</td>-->
        <!--<td>{{item.haveOverdue==1?'是':'否'}}</td>-->
        <!--<td>-->
        <!--&lt;!&ndash; <a href="javascript:void(0);" @click="gotoDetail(item.id,'browser')">&nbsp;查看&nbsp;</a>&ndash;&gt;-->
        <!--<a href="javascript:void(0);" @click="goDetail('edit',i)" v-if="isShowBtn('salesAccountEdit')">&nbsp;编辑&nbsp;</a>-->
        <!--<a href="javascript:void(0);" v-else style="color:#ddd;cursor: no-drop">&nbsp;编辑&nbsp;</a>-->
        <!--</td>-->
        <!--</tr>-->
        <!--</tbody>-->
        <!--</table>-->

    </div>
    <div class="oa-pager text-center" style="margin-top: 5px;">
        共
        <span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;
        <span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;
        <span class="oa-pager-button" id="first">首页</span>
        <span class="oa-pager-button" id="prev">上一页</span>
        <span class="oa-pager-button" id="next">下一页</span>
        <span class="oa-pager-button" id="last">尾页</span>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script src="/dist/plugins/fixedTable/fixed-table.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    function refresh() {
        $.wyui.page.getByPage();
    }

    var app = new Vue({
        el: '#app',
        data: {
            selectCom: '请选择公司',
            itemsCom: [],
            rightOp: [],//权限列表
            companyList: [],
            searchParams: {
                userId: $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id,
                customerKeyId: '',
                createUserId: '',
                customerKey: '',
                createUserName: '',
                auditFlag: '',
                serialNo: '',
                selectCom: "",
                haveSettle: '',
            },
            currentUser: getCurrentUser(),
            list: {
                main: [],
            },
        },
        methods: {
            timeFormat:function(time){
                if (time) {
                    return new Date(time).Format(TimeFormat.pcListYearShort)
                } else {
                    return '';
                }
            },
            exportGet: function () {
                var that = this;

                $.dialog({
                    content: 'url:/page/apply/salesAccount/chooseExportGetField.html?userId=' + that.searchParams.userId + "&customerKey=" + that.searchParams.customerKey + "&auditFlag=" + that.searchParams.auditFlag + "&haveSettle=" + that.searchParams.haveSettle + "&selectCom=" + that.searchParams.selectCom + "&haveDelivery=" + '1',
                    title: '选择导出字段',
                    width: 999,
                    height: 460,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            isShowBtn: function (eName) {
                if (getCurrentUser().superUser || ($.inArray(eName, this.rightOp) > -1) || getCurrentUser().roleName == '订货支持') {
                    return true;
                } else {
                    return false;
                }
            },
            checkedOne: function (item) {
                if (this.selectId == item.id) {
                    // 如果已经包含了该id, 则去除(单选按钮由选中变为非选中状态)
                    this.selectId = ""
                } else {
                    // 选中该checkbox
                    this.selectId = item.id
                }

                console.log(item);
            },
            goDetail: function (type, i) {
                top.closeTabByPageId("contractDetail");
                var that = this;
                var id = that.list.main[i].id;
                var buyType = that.list.main[i].buyType;
                var condition = '?id=' + id + '&buyType=' + buyType;
                if (type == 'look') {
                    condition += '&pageType=look';
                    var haveHistory = false;
                    $.wyui.postLoadMethod("/contractMain/getHtmlHistory.json", {mainId: id}, function (r) {
                        if (r.result && r.result.html) {
                            haveHistory = true;
                        }
                        console.log(haveHistory)
                        if (haveHistory) {
                            top.addTabs({
                                id: 'contractDetail',
                                title: '合同详情',
                                close: true,
                                url: 'apply/contract/detail_history.html' + condition + '&mainId=' + id,
                            });
                        } else {
                            top.addTabs({
                                id: 'contractDetail',
                                title: '合同详情',
                                close: true,
                                url: 'apply/contract/detail_new.html' + condition
                            });
                        }

                    }, false, true);

                }
                if (type == 'edit') {
                    condition += '&pageType=edit';
                    top.addTabs({
                        id: 'salesAccount',
                        title: '销售台账详情页',
                        close: true,
                        url: 'apply/salesAccount/detail.html' + condition
                    });
                    /*var H = $(window).height() - 50;
                    top.$.dialog({
                        content: 'url:/page/apply/salesAccount/detail.html' + condition ,
                        title: '销售台账详情页',
                        width: 904,
                        height: H,
                        max: false,
                        min: false,
                        lock: true
                    });*/
                }
            },
            search: function () {
                var that = this;
                that.searchParams.selectCom = that.selectCom;
                if (that.searchParams.selectCom == "甘肃&宁夏") {
                    that.searchParams.selectCom = "甘肃"
                }
                if (that.searchParams.haveSettle) {
                    that.searchParams.haveSettle = '1';
                } else {
                    that.searchParams.haveSettle = '';
                }
                $.wyui.page.queryParams.requestPage = 1;
                $.extend($.wyui.page.queryParams, trimRN(that.searchParams));
                $.wyui.page.getByPage();
            },
            searchAll: function () {
                var that = this;
                if (that.searchParams.selectCom == "甘肃&宁夏") {
                    that.searchParams.selectCom = "甘肃"
                }
                if (that.searchParams.haveSettle == '') {
                    that.searchParams.haveSettle = '1';
                } else {
                    that.searchParams.haveSettle = '';
                }
                $.wyui.page.queryParams.requestPage = 1;
                $.extend($.wyui.page.queryParams, trimRN(that.searchParams));
                console.log($.wyui.page.queryParams);
                $.wyui.page.getByPage();
            },
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            getHeight:function(){
                var H = $(window).height()
                var allHeight=$("#divMain").height();
                var tableHeight=$("#tableMain").height();
                console.log(allHeight)
                console.log(tableHeight)
                var flag= allHeight>=tableHeight?true:false
                console.log(flag)
                if (flag){
                    $('.tdMore').each(function(){
                        $(this).css('width','17px');
                    });
                }else{
                    $('.tdMore').each(function(){
                        $(this).css('width','0px');
                    });
                }
                $(".iframeSaleFixed").height(H - 106);
            },
        },
        mounted: function () {
            var that = this;
            /*首先显示公司下拉表*/
            that.selectCom = "请选择公司"
            $.wyui.postMethod('/companyBrand/findCompanyList.json', {userId: getCurrentUser().id}, function (r) {
                console.log(r);
                that.itemsCom = r.companies;
            });
            /*$.wyui.postMethod(urlConfig.system.company.getCompanyByUserId, {userId:getCurrentUser().id}, function (r) {
                console.log(r);
                that.companyList=r;
            });*/
            //查询用户有哪些权限
            $.wyui.postMethod(urlConfig.system.rightOp.getRightOpByUserId, {userId: getCurrentUser().id}, function (rightOp) {
                for (var i = 0; i < rightOp.length; i++) {
                    that.rightOp.push(rightOp[i].eName);
                }

                console.log("权限列表如下：")
                console.log(that.rightOp);
            });

        }
    });
    //分页
    $.wyui.page.dataUrl = server.ip + "/contractMain/selectContractSalesList.json";
    $.wyui.page.queryParams.pageType = $.wyui.page.urlParams.pageType;
    $.wyui.page.queryParams.userId = $.wyui.page.urlParams.userId ? $.wyui.page.urlParams.userId : getCurrentUser().id;
    $.wyui.page.queryParams.auditFlag = 1;
    /*  $.wyui.page.queryParams.outBoundType = 0;*/
    $.wyui.page.queryParams.haveDelivery = 1;
    $.wyui.page.queryParams.haveSettle = '';
    $.extend($.wyui.page.queryParams);
    $.wyui.page.getByPage_callback = function (records) {
        console.log(records)
        app.list.main = records;
        document.getElementById("scrollDiv").scrollTop = 0;
        setTimeout(function () {
            app.getHeight();
        },10)
        app.getHeight();
    };
    $.wyui.page.getByPage_scroll_callback = function (list) {
        if (list.length < 30) {
            isLoad = false;
        } else {
            for (var i = 0; i < list.length; i++) {
                app.list.push(list[i]);
            }
            isLoad = true;
        }
    };
    $(function () {
        $("#txtParent").autoComplete({
            url: server.ip + urlConfig.contract.getContractBuyer,
            render: function (r, panel) {
                for (var i = 0; i < r.length; i++) {
                    $("<li></li>").data("autoComplete",
                        r[i]).html("<a>" + r[i].customerName + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + r[i].customerTel + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (r) {
                app.searchParams.customerKey = r.customerName;
                return false;
            },
            height: 210,
            width: 300
        })
        $("#regionManagerName").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                app.searchParams.regionManagerKeyId = user.id;
                app.searchParams.createUserName = user.name;
                return false;
            },
            height: 210,
            width: 220
        });

    });
</script>
<script>
    //初始化FixedTable
    $(".fixed-table-box").fixedTable();
</script>
</body>
</html>